#pragma once

#include "../umlmodel_global.h"

#include <memory>
#include <vector>

#include "ValueSpecification.h"

using std::make_shared;
using std::shared_ptr;
using std::vector;

namespace uml {
class InstanceSpecification;

/// <summary>
/// InstanceValue
/// An InstanceValue is a ValueSpecification that identifies an instance.
/// </summary>
class UMLMODEL_EXPORT InstanceValue : public ValueSpecification {

public: // Constructors and destructors
    explicit InstanceValue(const QString& umlType="uml::InstanceValue");

public: // JsonSerializable override
    void fromJson(const QJsonObject& json, QStringList& errorList) override;
    void toJson(QJsonObject& json) override;

public: // Properties
    /// <summary>
    /// instance getter
    /// The InstanceSpecification that represents the specified value.
    /// </summary>
    shared_ptr<InstanceSpecification> instance() const;

    /// <summary>
    /// instance setter
    /// The InstanceSpecification that represents the specified value.
    /// </summary>
    void setInstance(shared_ptr<InstanceSpecification> value);

private: // Fields
    /// <summary>
    /// instance
    /// The InstanceSpecification that represents the specified value.
    /// </summary>
    shared_ptr<InstanceSpecification> instance_;

};

} // namespace uml
